package stream;

import java.util.*;
import java.util.stream.Stream;

public class Demo3 {
    public static void main(String[] args) {
        //单列集合
        Collection<String> c = new ArrayList<>();
        c.add("acv");
        c.add("avv");
        c.add("bbv");
        c.stream().forEach(s1 -> System.out.println(s1));
        System.out.println("============");
        //双列集合
        Map<String, Integer> map = new HashMap<>();
        map.put("aaa", 11);
        map.put("bbb", 13);
        map.entrySet().stream().forEach(s2 -> System.out.println(s2));
        System.out.println("============");
        //数组
        int[] arr = {1, 2, 3, 4};
        Arrays.stream(arr).forEach(s -> System.out.println(s));
        System.out.println("============");
        //同种数据类型多个数据
        Stream.of(1, 2, 3, 4, 5).forEach(s -> System.out.println(s));
    }
}
